package com.mrd.gtimp.business.entity;

import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Transient;

/**
 * Created by lenovo on 2016/9/19.
 */

/**
 * 查验货物主表
 */
@Entity(name = "T_BIZ_INSPECTION_GOODS")
public class InspectionGoods implements Serializable {
    private static final long serialVersionUID = -5081135538372831091L;

    @Id
    @GeneratedValue(generator = "paymentableGenerator")
    @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
    @Column(name = "ID_")
    private String id;

    @ManyToOne
    @JoinColumn(name = "DECLARATION_ID_")
    private Declaration declaration;

    /**
     * 查验柜号
     */
    @Column(name = "CONTAINER_NO_")
    private String containerNo;

    /**
     * 查验商品
     */
    @ManyToOne
    @JoinColumn(name = "INSPECTION_COMMODITY_ID_")
    private Commodity inspectionCommodity;

    /**
     * 查验时间
     */
    @Column(name = "CREATE_TIME_")
    private Date createTime;

    @OneToMany(mappedBy = "inspectionGoods", cascade = CascadeType.ALL)
    private List<InspectionGoodsDetails> inspectionGoodsDetailsList;

    /**
     * 查验完成情况，1-查验中，2-已查验
     */
    @Column(name = "STATE_")
    private String state;

    /**
     * 查验单位&查验项目
     */
    @Transient
    private String inspectionCompanyProject;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getContainerNo() {
        return containerNo;
    }

    public void setContainerNo(String containerNo) {
        this.containerNo = containerNo;
    }

    public List<InspectionGoodsDetails> getInspectionGoodsDetailsList() {
        return inspectionGoodsDetailsList;
    }

    public void setInspectionGoodsDetailsList(List<InspectionGoodsDetails> inspectionGoodsDetailsList) {
        this.inspectionGoodsDetailsList = inspectionGoodsDetailsList;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }


    public Declaration getDeclaration() {
        return declaration;
    }

    public void setDeclaration(Declaration declaration) {
        this.declaration = declaration;
    }

    public Commodity getInspectionCommodity() {
        return inspectionCommodity;
    }

    public void setInspectionCommodity(Commodity inspectionCommodity) {
        this.inspectionCommodity = inspectionCommodity;
    }

    public String getInspectionCompanyProject() {
        return inspectionCompanyProject;
    }

    public void setInspectionCompanyProject(String inspectionCompanyProject) {
        this.inspectionCompanyProject = inspectionCompanyProject;
    }
}
